<script>
	import Vue from 'vue'
	export default {
		async onLaunch() {
			uni.getSystemInfo({
				success: function(e) {
					uni.setStorageSync('platform', e.platform)
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
					};
					// #endif
					// #ifdef MP-WEIXIN
					Vue.prototype.StatusBar = e.statusBarHeight;
					let custom = wx.getMenuButtonBoundingClientRect();
					Vue.prototype.Custom = custom;
					Vue.prototype.CustomBar = custom.bottom + custom.top - e.statusBarHeight;
					// #endif        
					// #ifdef MP-ALIPAY
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				}
			})
			if (!this.helper.getStorageSync('lang')) {
				this.helper.setStorageSync('lang', 'en')
				this.$i18n.locale = 'en'
			} else {
				this.$i18n.locale = this.helper.getStorageSync('lang') == 'zh-cn' ? 'zh-Hans' : 'en'
			}
			// let token = uni.getStorageSync('token')
			// if (!token) {
			// 	await this.helper.delay(500, () => {
			// 		uni.switchTab({
			// 			url: '/pages/tabBar/login'
			// 		})
			// 	})
			// }
		},
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
	@import "colorui/main.css";
	@import "colorui/icon.css";
</style>